package edu.scau.ojforwarder.bean;

public enum  HduError implements IError {
    SUCCESS(0, "成功！"),

    //查询错误
    NO_SUCH_SUBMISSION(1001, "submissionId错误，没有这个提交记录！"),

    //提交错误
    CODE_LENGTH_ERROR(2001, "代码长度必须大于50字节，小于等于65536字节！"),
    CONNECTION_ERROR(2002, "连接HDU服务器失败！"),
    LOGIN_FAILED(2003, "登录失败，账号密码不正确或没有比赛权限！"),
    NOT_LOGGED_ERROR(2004, "登录成功,但仍然提示未登录！"),
    NO_SUCH_PROBLEM(2005, "没有这个比赛，或没有这个题目！"),
    NOT_IN_RUNNING_TIME(2006, "无法提交，不在比赛时间内！"),
    OTHER_SUBMIT_EROOR(2007, "提交失败，未知错误！"),

    READ_RESPONSE_ENTITY_ERROR(3001, "读取Entity失败");


    private int code;
    private String msg;

    HduError(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
